<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\ApiBaseController;
use App\Http\Middleware\AdminPermissionMiddleware;
use Modules\Admin\Entities\Admin;

class ApiController extends ApiBaseController
{
    protected $auth = 'auth:admin';
    protected ?Admin $admin = null;

    public function __construct()
    {
        parent::__construct();
        $this->middleware(function ($request, $next) {
            $this->admin = auth()->guard('admin')->user();
            return $next($request);
        });
    }
}
